#!/bin/bash

rm -fr nowide nowide_standalone nowide_standalone.zip boost_nowide boost_nowide.zip
mkdir -p nowide/nowide
mkdir -p nowide/src
mkdir -p nowide/test

cp ../include/boost/nowide/*.hpp nowide/nowide
cp ../src/*.cpp nowide/src
cp ../test/*.cpp ../test/*.hpp nowide/test
cp ./*.hpp nowide/nowide/

SOURCES="nowide/test/* nowide/src/* nowide/nowide/*"


sed 's/BOOST_NOWIDE_/NOWIDE_/g' -i $SOURCES
sed 's/BOOST_/NOWIDE_/g' -i $SOURCES
sed 's/boost::nowide::/nowide::/g' -i $SOURCES
sed 's/boost::nowide/nowide/g' -i $SOURCES
sed 's/boost::locale::/nowide::/g' -i $SOURCES
sed 's/boost::/nowide::/g' -i $SOURCES
sed 's/namespace boost {//' -i $SOURCES
sed 's/} *\/\/ *namespace boost//' -i $SOURCES
sed 's/<boost\/locale\//<nowide\//g' -i $SOURCES
sed 's/<boost\/nowide\//<nowide\//g' -i $SOURCES
sed 's/<boost\//<nowide\//g' -i $SOURCES

cp CMakeLists.txt nowide/
cp -a nowide nowide_standalone
zip -r nowide_standalone.zip  nowide_standalone

#mkdir boost_nowide
#cp -a ../boost ../libs boost_nowide
#zip -r boost_nowide.zip boost_nowide
